<template>
    <div class="container">
        <h1>欢迎：{{ name }}</h1>
        <School></School>

        <Student @myEvent="getStudentName"></Student>

        <!-- <Student ref="stu"></Student> -->
    </div>
</template>

<script>

import Student from './components/Student';
import School from './components/School';

export default {
    name: 'App',
    components:{Student,School},
    data() {
        return {
            name:''
        }
    },
    mounted() {
        // this.$refs.stu.$on('myEvent',this.getStudentName)
    },
    methods: {
        getStudentName(name,...param){
            console.info(param)
            this.name = name
        }
    },
}
</script>

<style>
.container{
    background-color: gray;
    padding: 20px;
}
</style>